/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
//
//  NOTE!: This file is autogenerated - do not modify!
//         if you need to make a change, please see the Groovy scripts in the
//         activemq-core module
//

using System;

using Apache.NMS.ActiveMQ.State;

namespace Apache.NMS.ActiveMQ.Commands
{
	/// <summary>
	///  The ActiveMQ PartialCommand Command
	/// </summary>
	public class PartialCommand : BaseDataStructure, Command
	{
		public const byte ID_PartialCommand = 60;

		int commandId;
		byte[] data;

		public override string ToString()
		{
			return GetType().Name + "["
				+ " CommandId=" + CommandId
				+ " Data=" + Data
				+ " ]";

		}

		public override byte GetDataStructureType()
		{
			return ID_PartialCommand;
		}


		// Properties

		public int CommandId
		{
			get { return commandId; }
			set { this.commandId = value; }
		}

		public byte[] Data
		{
			get { return data; }
			set { this.data = value; }
		}

		public bool IsMessage
		{
			get
			{
				return false;
			}
		}

		public bool IsShutdownInfo
		{
			get
			{
				return false;
			}
		}

		public bool IsBrokerInfo
		{
			get
			{
				return false;
			}
		}

		public bool IsResponse
		{
			get
			{
				return false;
			}
		}

		public virtual bool ResponseRequired
		{
			get
			{
				return false;
			}
			set
			{
				throw new ApplicationException("PartialCommand should not set ResponseRequired");
			}
		}

		public virtual Response visit(ICommandVisitor visitor)
		{
			throw new ApplicationException("The transport layer should filter out PartialCommand instances but received: " + this);
		}
	}
}
